package com.zmn.plat.services.impl.orderconfig.oderstock.sp;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zmn.plat.model.entity.orderconfig.orderstock.sp.SpConfig;
import com.zmn.plat.model.entity.orderconfig.orderstock.sp.SpConfigQuery;
import com.zmn.plat.persistence.interfaces.orderconfig.orderstock.sp.SpConfigDao;
import com.zmn.plat.services.interfaces.orderconfig.oderstock.sp.SpConfigService;

import lombok.extern.slf4j.Slf4j;

/**
 * 描述: 服务商库存配置基础接口实现类
 *
 * @author tanghongjun
 * @since 2020-03-17 11:23:43
 **/
@Slf4j
@Service
public class SpConfigServiceImpl implements SpConfigService {

    private static final String TAG = "服务商库存配置基础服务接口";

    @Resource
    private SpConfigDao spConfigDao;

    @Override
    public SpConfig findByKey(Integer id) {
        return spConfigDao.findByKey(id);
    }

    @Override
    public List<SpConfig> listPageByQuery(SpConfigQuery query) {
        return spConfigDao.listPageByQuery(query);
    }

    @Override
    public List<SpConfig> listByQuery(SpConfigQuery query) {
        return spConfigDao.listByQuery(query);
    }

    @Override
    public List<SpConfig> listCloseSpBySpIdListAndCityAndCateg(List<Integer> spIdList, Date date, Integer cityId, Integer servCategId) {
        return spConfigDao.listCloseSpBySpIdListAndCityAndCateg(spIdList, date, cityId, servCategId);
    }

    @Override
    public List<SpConfig> listNotCloseSpBySpIdListAndCityAndCateg(List<Integer> spIdList, Date date, Integer cityId, Integer servCategId) {
        return spConfigDao.listNotCloseSpBySpIdListAndCityAndCateg(spIdList, date, cityId, servCategId);
    }

    @Override
    public List<SpConfig> listBySpIdListAndCityAndCateg(List<Integer> spIdList, Date date, Integer cityId, Integer servCategId) {
        return spConfigDao.listBySpIdListAndCityAndCateg(spIdList, date, cityId, servCategId);
    }

    @Override
    public Integer countByQuery(SpConfigQuery query) {
        return spConfigDao.countByQuery(query);
    }

    @Override
    public Integer updateByKey(SpConfig spConfig) {
        return spConfigDao.updateByKey(spConfig);
    }

    @Override
    public Integer insert(SpConfig spConfig) {
        return spConfigDao.insert(spConfig);
    }

    @Override
    public Integer insertBatch(List<SpConfig> list) {
        return spConfigDao.insertBatch(list);
    }

    @Override
    public Integer deleteByKey(Integer id) {
        return spConfigDao.deleteByKey(id);
    }
}